//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package org.quickserver.util.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.quickserver.net.model.GB268753QNS;
import org.quickserver.net.model.GB26875SetUp;
import org.quickserver.net.model.GBServerData;
import org.quickserver.net.model.GBServerDataAll;
import org.quickserver.net.model.GBServerDataS;
import org.quickserver.net.server.ClientHandler;

public class ReadSSBUtil {
    public ReadSSBUtil() {
    }

    public static Map<String, Object> sendRead(String str, String uniqueCode, Date date, int type) {
        try {
            Object obj = GBServerDataAll.handlerMap.get(uniqueCode);
            if (obj == null) {
                return ReturnUtil.Error("此传输装置未连接，查询失败");
            } else {
                ClientHandler handler = (ClientHandler)obj;
                GBServerDataS ec = (GBServerDataS)handler.getClientData();
                if (ec == null) {
                    return ReturnUtil.Error("此传输装置未连接，查询失败");
                } else {
                	handler.sendClientBinary(dataProcessing.hexStrToByteArray(str));
                    boolean flag = false;
                    Thread.sleep(1500L);
                    
                    for(int i = 0; i < 5; ++i) {
                        if(null != ec.getGb268753qns()) {
                        	flag=true;
                        	break;
                        }
                        Thread.sleep(1000L);
                    }
                    GB268753QNS gb268753qns=(GB268753QNS) ec.getGb268753qns().clone();
                    ec.setGb268753qns(null);
                    if (flag) {
                        return ReturnUtil.Success("查询成功", gb268753qns);
                    } else {
                        return ReturnUtil.Error("查询失败");
                    }
                }
            }
        } catch (Exception var24) {
            return ReturnUtil.Error("查询失败");
        }
    }
}
